<?php
session_start();
require_once 'connect/connect.php';
extract($_POST);
$tbl_name="forum_question";
$topic=$_POST['topic'];
$detail=$_POST['detail'];
$name=$_SESSION['username'];

$datetime=date("d/m/y h:i:s");
$sql="INSERT INTO $tbl_name(topic, detail, datetime,name)VALUES('$topic', '$detail', '$datetime','$name')";
$result=mysql_query($sql)or die('Query failed: ' . mysql_error());

if($result){
header("location:main_forum.php");
}
else {
    var_dump($result);
}
mysql_close();
require_once 'footer.php';
?>